0baf22
@@ -897,6 +897,14 @@
public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
 				instance = bw.getWrappedInstance();
 			}
 		}
+		catch (BeanCreationException ex) {
+			// Can only happen when getting a FactoryBean.
+			if (logger.isDebugEnabled()) {
+				logger.debug("Bean creation exception on non-singleton FactoryBean type check: " + ex);
+			}
+			onSuppressedException(ex);
+			return null;
+		}
 		finally {
 			// Finished partial creation of this bean.
 			afterPrototypeCreation(beanName);
